package com.sari.common.persistence;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
 * 数据Entity类
 */
@MappedSuperclass
public abstract class AutoEntity<T> extends BaseEntity<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    protected Integer id;        // 编号

    public AutoEntity() {
        super();
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Id
    @GeneratedValue(strategy= GenerationType.AUTO)
    public Integer getId() {
        return id;
    }
}
